<template>
    <div>
        <van-tree-select
            :items="items"
            :active-id.sync="activeIds"
            :main-active-index="mainActiveIndex"
            :height="height"
            @click-nav="clickNav"
            @click-item="clickItem"
        >
            <template #content>
                <slot name="content"></slot>
            </template>
        </van-tree-select>
    </div>
</template>
<script>
export default {
    name:"eagle-tree-select",
    props:{
        items:{
            type:Array,
            default:() => [],
        },
        activeIds:{
            type:[Number,String,Array],
            default:() => 0,
        },
        mainActiveIndex:{
            type:[Number,String],
            default:() => 0,
        },
        height:{
            type:[Number,String],
            default:()=>"300px"
        }
    },
    methods:{
        clickNav(index){
            this.$emit("click-nav",index);
        },
        clickItem(data){
            this.$emit("click-item",data);
        }
    }
}
</script>